package com.temi.iot.jwt;

import com.temi.iot.kit.HttpKit;

/**
 * Created by
 *
 * @author sheng
 * @date 18/3/19.
 */
public class Login {

    /**
     * 获取当前登录的id
     */
    public static Long id() {
        return (Long) HttpKit.getRequest().getAttribute("userId");
    }

    /**
     * 获取当前登录的openId
     */
    public static String openId() {
        return (String) HttpKit.getRequest().getAttribute("openId");
    }

    /**
     * 获取当前登录的项目
     */
    public static Long project() {
        return (Long) HttpKit.getRequest().getAttribute("project");
    }

    /**
     * 获取当前权限
     */
    public static Long permission() {
        return (Long) HttpKit.getRequest().getAttribute("per");
    }

    /**
     * 获取当前手机号码
     * @return
     */
    public static String phone(){return (String)HttpKit.getRequest().getAttribute("phone");}

    /**
     * 获取ip
     */
    public static String ip() {
        return (String) HttpKit.getRequest().getAttribute("ip");
    }
}
